<!--
 * @Author: gyc
 * @Date: 2020-04-22 09:59:12
 * @LastEditTime: 2020-05-02 10:46:57
 * @Description: Nuxt测试版
 -->
<template>
  <div class="axios-loading" :style="height">
    <div class="loading-line">
      <div class="line" id="line_1"></div>
      <div class="line" id="line_2"></div>
      <div class="line" id="line_3"></div>
      <div class="line" id="line_4"></div>
      <div class="line" id="line_5"></div>
      <div class="line" id="line_6"></div>
      <div class="line" id="line_7"></div>
      <div class="line" id="line_8"></div>
    </div>
  </div>
</template>
<script>
export default {
  name: "axiosLoading",
  data() {
    return {
      height: "height:" + window.innerHeight + "px"
    };
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
.axios-loading {
  position: fixed;
  display: flex;
  flex-direction: column;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  justify-content: center;
  align-items: center;
  background-color: white;
}
.loading-line {
  position: relative;
  width: 60px;
  height: 60px;
  overflow: hidden;
  .line {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: black;
    opacity: 0.2;
    top: 0;
    left: 26px;
    transform-origin: 4px 30px;
    overflow: hidden;
  }
  @for $i from 1 through 8 {
    #line_#{$i} {
      // animation-delay: 2s;
      transform: rotate((45deg * $i)-45deg) translateZ(0);
      animation: up2down 1.2s ease-in-out 0.15s * (($i)-1) infinite;
    }
  }
}
@keyframes up2down {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}
</style>